package game;

import java.awt.event.KeyEvent;
import java.awt.event.KeyListener;
import java.io.OutputStream;
import java.net.Socket;

public class KeyClass implements KeyListener {
	private GamePlayer g;

	/**
	 * 
	 * @param g
	 */
	public KeyClass(GamePlayer g) {
		this.g = g;
	}

	/**
	 * 
	 * @param ke
	 */
	public void keyPressed(KeyEvent ke) {
		if (ke.getKeyCode() == KeyEvent.VK_UP) {
			g.playerMoved("up");
		}

		if (ke.getKeyCode() == KeyEvent.VK_DOWN) {
			g.playerMoved("down");
		}
		
		if (ke.getKeyCode() == KeyEvent.VK_LEFT) {
			g.playerMoved("left");
		}
		
		if (ke.getKeyCode() == KeyEvent.VK_RIGHT) {
			g.playerMoved("right");
		}
		
		
	}

	/**
	 * 
	 * @param ke
	 */
	public void keyReleased(KeyEvent ke) {

	}

	/**
	 * @param ke
	 */
	public void keyTyped(KeyEvent ke) {

	}
}